package com.douqu.game.core.config.challenge;

import com.douqu.game.core.config.common.GoodsData;
import com.douqu.game.core.entity.GameObject;
import com.douqu.game.core.util.LogUtils;


/**
* @author wangzhenfei
*         2017-08-08 16:09
*          世界boss
*/
public class ArenaRobotConfig extends GameObject {


    public GoodsData star;
    public GoodsData soldierLv;
    public GoodsData equipLv;
    public GoodsData accessoryLv;
    public GoodsData accessoryRank;
    public GoodsData orangeCardNum;

    @Override
    public boolean check() {
        if (star == null) {
            LogUtils.error("ArenaRobotConfig check star is null -> id:" + id + " name:" + name);
            return false;
        }
        if (soldierLv == null) {
            LogUtils.error("ArenaRobotConfig check soldierLv is null -> id:" + id + " name:" + name);
            return false;
        }
        if (equipLv == null) {
            LogUtils.error("ArenaRobotConfig check equipLv is null -> id:" + id + " name:" + name);
            return false;
        }
        if (accessoryLv == null) {
            LogUtils.error("ArenaRobotConfig check accessoryLv is null -> id:" + id + " name:" + name);
            return false;
        }
        if (accessoryRank == null) {
            LogUtils.error("ArenaRobotConfig check accessoryRank is null -> id:" + id + " name:" + name);
            return false;
        }
        if (orangeCardNum == null) {
            LogUtils.error("ArenaRobotConfig check orangeCardNum is null -> id:" + id + " name:" + name);
            return false;
        }
        return super.check();
    }


    @Override
    public boolean setVariable(String key, String value) {
        if ("star".equals(key)) {
            star = new GoodsData(value);
            return true;
        } else if ("soldierLv".equals(key)) {
            soldierLv = new GoodsData(value);
            return true;
        } else if ("equipLv".equals(key)) {
            equipLv = new GoodsData(value);
            return true;
        }else if ("accessoryLv".equals(key)) {
            accessoryLv = new GoodsData(value);
            return true;
        }else if ("accessoryRank".equals(key)) {
            accessoryRank = new GoodsData(value);
            return true;
        }else if ("orangeCardNum".equals(key)) {
            orangeCardNum = new GoodsData(value);
            return true;
        }else
            return super.setVariable(key, value);
    }

}
